import Hash from '@ohos.file.hash';
import { CMError } from '../../../../../../common/base/oh_modules/coremail/Index';

class FileHashCode {
  public async getFileHash(path: string): Promise<string> {
    let filePath = path + "/test.txt";
    Hash.hash(filePath, "sha256").then((str) => {
      return new Promise((resolve, reject) => {
        resolve(str)
      })
    }).catch((err: Error) => {
      return new Promise((resolve, reject) => {
        reject(err.message)
      })
    });
    return "";
  }
}
